export default ({ app: { router }, store }) => {
    /* 每次路由变更时进行pv统计 */
    router.afterEach((to, from) => {
      /* 告诉增加一个PV */
      try {
        window._hmt = window._hmt || []
        window._hmt.push(['_trackPageview', to.fullPath])

        var bp = document.createElement('script');
          var curProtocol = window.location.protocol.split(':')[0];
          if (curProtocol === 'https'){
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        }
        else{
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
          var s = document.getElementsByTagName("script")[0];
          s.parentNode.insertBefore(bp, s);
      } catch (e) {}      
    })
  }